package com.GUI.Lesson05;
//复选框

import javax.swing.*;
import java.awt.*;
import java.net.URL;

public class JButtonDemo03 extends JFrame {

    public JButtonDemo03(){
        //获得容器
        Container container = this.getContentPane();

        //将一个图片变成图标
        URL resource = JButtonDemo.class.getResource("tx.png");
        Icon icon = new ImageIcon(resource);

        //多选框
        Checkbox checkbox1 = new Checkbox("多选框1");
        Checkbox checkbox2 = new Checkbox("多选框2");
        Checkbox checkbox3 = new Checkbox("多选框3");


        container.add(checkbox1,BorderLayout.NORTH);
        container.add(checkbox2,BorderLayout.CENTER);
        container.add(checkbox3,BorderLayout.SOUTH);
        //基本属性
        this.setVisible(true);
        this.setBounds(20,20,100,100);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

    }

    public static void main(String[] args) {
        new JButtonDemo03();
    }
}
